package com.flnet.web.controller.treasure;

import com.flnet.treasure.domain.TChannel;
import com.flnet.treasure.service.ITChannelService;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(produces = {"application/json;charset=UTF-8"},value = "/api")
public class TChannelListController {

    @Autowired
    private ITChannelService tChannelService;

    @RequestMapping(value = "/getGameMenu")
    @ResponseBody
    public String getGameMenu(String page,Map map){
        List<TChannel> list = tChannelService.selectTChannelList(null);
        map.put("gameList", list);
        //Gson gson = new Gson();
        Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
        String jsonStr = gson.toJson(map);
        return jsonStr;
    }
}
